extends "../lisailiu-2/lisailiu-2.gd"

func _extInit():
	._extInit()
	lv = 3             #等级的设置
	addSkill("开局在自身位置插上战旗，战旗3格范围内的所有友军提高20%冷却速度、射速，每80点炮击提高2%加成", "爱丽丝之帜")

var flagCell
var effs
func _upS():
	._upS()
	if flagCell == null:return
	var chas = getCellChas(flagCell, p3, 2)
	for i in chas:
		if i.hasBuff("b_lisailiu2") == null:
			var n = 0.2 + att.atk / 80.0 * 0.02
			i.addBuff(b_lisailiu2.new(n))
var p3 = 3
func _onBattleStart():
	._onBattleStart()
	flagCell = cell
	if team == 1:
		effs = createCustEff(position, "eff/flag", 10, true, 1, Vector2(0, -100))

func _onBattleEnd():
	._onBattleEnd()
	flagCell = null
	if is_instance_valid(effs):
		effs.queue_free()

func _onDeath(atkInfo):
	._onDeath(atkInfo)
	if is_instance_valid(effs):
		effs.queue_free()

class b_lisailiu2:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init(cd):
		attInit()
		id = "b_lisailiu2"	
		att.cd = cd
		att.spd = cd
		buffName = "爱丽丝之帜"